package edu.xjtu.jih.demands;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
@Mapper //本注解明确说明本接口是mybatis的映射器
public interface DemandsDao {
    @Insert("insert into items values (#{item_id},#{item_name},#{item_price},#{item_image},#{item_desc},#{item_label},#{status})")
    void insertDemand(DemandsDto dto);
    @Insert("insert into user_item values (#{user_id},#{item_id},#{upload},#{collect},#{time})")
    void insertUserDemand(DemandsDto dto);
    @Select("select max(item_id) as maxItemId from items")
    int selectItemId();
}
